package com.unicomcz.commision;

import java.sql.ResultSet;
import java.text.SimpleDateFormat;
import java.util.List;

import com.unicomcz.DetailPageAction;

public class DetailKcAction extends DetailPageAction
{
    public String getSqlStr() {
        String sqlStr="SELECT acct_month 月份,serial_number 号码,open_time 激活时间,brand 品牌,charge 充值金额,comm 佣金 " + 
                " FROM dls_detail_kc where depart_id=? and acct_month=? order by open_time,serial_number";
        return sqlStr;
    }
    public Object[] getParams() {
        return new Object[]{userInfo.getDepartCode(),acctMonth};
    }
    protected void regQueryParam() throws Exception{
        if ((acctMonth==null)||(acctMonth.length()==0)) {
            SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM");
            acctMonth=sf.format(new java.util.Date());
        }
        log.debug(acctMonth);
        log.debug(userInfo.getUserId());
        pstmt.setString(1, userInfo.getDepartCode());
        pstmt.setString(2, acctMonth);
    }
    protected void rs2List(ResultSet rs,List out) throws Exception{
        DetailSc t = new DetailSc();
        t.setAcctMonth(rs.getString(1));
        t.setSerialNumber(rs.getString(2));
        t.setOpenTime(rs.getString(3));
        t.setBrand(rs.getString(4));   
        t.setCharge(rs.getString(5));
        t.setComm(rs.getString(6));
        out.add(t);
    }
}
